package routers

import (
	"project1/middleware"

	"github.com/kataras/iris/v12"
	"github.com/kataras/iris/v12/middleware/requestid"
)

func InitRouters(app *iris.Application) {
	apiRouter := app.Party("/api")
	{
		apiRouter.Use(requestid.New())               // 生成唯一id
		apiRouter.Use(middleware.CheckAccountStatus) // 校验传了token的用户状态
		apiRouter.Use(middleware.CheckAdmin)         // 校验请求的账号是否属于超级管理员或管理员
	}
	InitUserRouter(apiRouter)       //用户
	InitCommRouter(apiRouter)       //通用
	InitEncryptionRouter(apiRouter) //加密
	InitBusinessRouter(apiRouter)   //业务
}
